import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('view/login/login'),
    meta: {
      title: '登录页'
    }
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('view/home/home'),
    meta: {
      title: '首页'
    }
  },
  {
    path: '/TrackManage',
    name: 'TrackManage',
    component: () => import('view/TrackManage/TrackManage'),
    meta: {
      title: '轨道管理'
    }
  },
  {
    path: '/report',
    name: 'report',
    component: () => import('view/report/report'),
    meta: {
      title: '报表'
    }
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('view/my/my'),
    meta: {
      title: '我的'
    }
  }
];

// add route path
routes.forEach(route => {
  route.path = route.path || '/' + (route.name || '');
});

const router = new Router({ routes });


export {
  router
};
